From: Florian Müllner Date: Fri, 5 Jan 2024 09:52:08 +0000 (+0100) Subject: extensions-app: Only change state if necessary X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~175 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e75a2ca146ddad1f586af196009592ee28db476c;p=gnome-shell.git extensions-app: Only change state if necessary The `state-set` signal is emitted to change the underlying state, which can have two reasons: 1. the user toggled the switch 2. the extension's `enabled` state changed externally In the second case, calling enable/disable is pointless at best, and can mess up the expected state by permanently disabling an extension that was disabled because of the global kill switch. Address this by only calling enable/disable if the new state does not already match the current value of the `enabled` property. Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7305 Fixes: fec523f83f ("extensions-app: Use new 'enabled' property") Part-of: --- diff --git a/subprojects/extensions-app/js/extensionRow.js b/subprojects/extensions-app/js/extensionRow.js index 5847fb193..dac3b7f01 100644 --- a/subprojects/extensions-app/js/extensionRow.js +++ b/subprojects/extensions-app/js/extensionRow.js @@ -59,7 +59,10 @@ export const ExtensionRow = GObject.registerClass({ this._bindActionEnabled(actionEntries); this._switch.connect('state-set', (sw, state) => { - const {uuid} = this._extension; + const {uuid, enabled} = this._extension; + if (enabled === state) + return true; + if (state) this._app.extensionManager.enableExtension(uuid); else